<template>
    <div class="app-container">
        <el-tabs tab-position="top" style="height: 650px; width: 95%">
            <el-tab-pane label="基本信息">
                <template>
                    <add-consumer :operate='operate' :consumer="consumerEntity"/>
                </template>
            </el-tab-pane>
            
            <el-tab-pane label="凭证">
                <template>
                    <credentials-box :consumerEntity="consumerEntity"/>
                </template>
            </el-tab-pane>


            <el-tab-pane label="插件列表">
                <template>
                    <plugin-table ref="pluginTable" :consumerId="consumerEntity.id"/>
                </template>
            </el-tab-pane>

            <el-tab-pane label="新增插件">
                <template>
                    <plugin-list :consumer="consumerEntity" @callback="handlePluginAddCallback"/>
                </template>
            </el-tab-pane>
        </el-tabs>
    </div>
</template>
<script>
import PluginList from '../components/pluginList.vue'
import PluginTable from '../components/pluginTable.vue'
import addConsumer from './addConsumer.vue'
import CredentialsBox from './credentialsBox.vue'
export default {
  components: { addConsumer, PluginTable, PluginList, CredentialsBox },
    props: {
        consumerEntity:{
            type: Object,
            required: false,
        }
    },
    data () {
        return {
            consumer:{},
            operate: "edit",   
                     
        }
    },
    created(){
        console.log("edit consumer:"+JSON.stringify(this.consumerEntity))
    },
    methods:{
        handlePluginAddCallback(payload){
            this.$refs.pluginTable.headlePlugins();
        }
    }
}
</script>
<style scoped>

</style>